package com.bmps.springcloud.insuredmicroservice.model.cancel;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * description:
 * 请求报文体
 *
 * @author jackdaw
 * @date 2019-11-27 11:48
 */
public class RequestBodyModel  implements Serializable {

    private static final long serialVersionUID = -2234754629728312395L;
    @NotBlank(message ="contNo节点不能为空")
    private String contNo;

    @NotBlank(message ="prtNo节点不能为空")
    private String prtNo;

    public String getContNo() {
        return contNo;
    }

    public void setContNo(String contNo) {
        this.contNo = contNo;
    }

    public String getPrtNo() {
        return prtNo;
    }

    public void setPrtNo(String prtNo) {
        this.prtNo = prtNo;
    }

    @Override
    public String toString() {
        return "RequestBodyModel{" +
                "contNo='" + contNo + '\'' +
                ", prtNo='" + prtNo + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (!(o instanceof RequestBodyModel)) {
            return false;
        }

        RequestBodyModel that = (RequestBodyModel) o;

        return new EqualsBuilder()
                .append(contNo, that.contNo)
                .append(prtNo, that.prtNo)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(contNo)
                .append(prtNo)
                .toHashCode();
    }
}
